// pages/appointment/appointment.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentTab: 0,
    dates: '2016-11-08',
    renshu:"30",
    renshu1:"12",
    Height: "2000" ,
    doctorList:[
      {
        image:"../image/personal.png",
        name: "张秀",
        section:"满诊",
        position:"主任医师",
        jieshou:'ashjahsjdhjahsdjhajshjadasdasdasdaadasdaasdasdadasdasasdasdaadadsads'
      },
      {
        image: "../image/personal.png",
        name: "张秀",
        section: "满诊",
        position: "主任医师",
        jieshou:'asklsjakljdklajksdsad'
      },
      {
        image: "../image/personal.png",
        name: "张秀",
        section: "满诊",
        position: "主任医师",
        jieshou:'asdasdadsadasddadasd'
      },
      {
        image: "../image/personal.png",
        name: "张秀",
        section: "满诊",
        position: "主任医师",
        jieshou:'sdfsfasfafafsafa'
      }
     
    ],
    doctorList1:[
      {
        image:"../image/personal.png",
        name: "张秀",
        section:"满诊",
        position:"主任医师",
        jieshou:'ashjahsjdhjahsdjhajshjadasdasdasdaadasdaasdasdadasdasasdasdaadadsads'
      },
      {
        image: "../image/personal.png",
        name: "张秀",
        section: "满诊",
        position: "主任医师",
        jieshou:'asklsjakljdklajksdsad'
      },
      {
        image: "../image/personal.png",
        name: "张秀",
        section: "满诊",
        position: "主任医师",
        jieshou:'asdasdadsadasddadasd'
      },
      {
        image: "../image/personal.png",
        name: "张秀",
        section: "满诊",
        position: "主任医师",
        jieshou:'sdfsfasfafafsafa'
      }
     
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      wx.setNavigationBarTitle({
        title: options.name 
      })
  },
  //跳转医生主页
  doctor(e){
    var item = JSON.stringify(e.currentTarget.dataset.item)
    console.log(item)
    wx.navigateTo({
      url: '../doctor/doctor?item=' +　item,
    })
  },
//滑动切换
swiperTab: function (e) {
  var that = this;
  that.setData({
   currentTab: e.detail.current
  });
 },
  //点击切换
  clickTab: function (e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
     return false;
    } else {
     that.setData({
      currentTab: e.target.dataset.current
     })
    }
   },
  imgHeight: function (e) {
    var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度
    var imgh = e.detail.height;//图片高度
    var imgw = e.detail.width;//图片宽度
    var swiperH = winWid * imgh / imgw + 150  + "px"//等比设置swiper的高度。 即 屏幕宽度 / swiper高度 = 图片宽度 / 图片高度  ==》swiper高度 = 屏幕宽度 * 图片高度 / 图片宽度
    this.setData({
      Height: swiperH//设置高度
    })
    console.log(swiperH)
  },
  //选择时间
  bindDateChange: function (e) {
    console.log(e.detail.value)
   this.setData({
     dates: e.detail.value
   })
 },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})